/*     */ package com.yc.service.export;
/*     */ 
/*     */ import btsm.bean.dbConnector;
/*     */ import com.yc.dao.export.AcdcDistributionExportDAO;
/*     */ import com.yc.dao.export.AirconditionExportDAO;
/*     */ import com.yc.dao.export.AntennaFeederExportDAO;
/*     */ import com.yc.dao.export.BTSExportDao;
/*     */ import com.yc.dao.export.BathunderExportDAO;
/*     */ import com.yc.dao.export.DynamoExportDAO;
/*     */ import com.yc.dao.export.EnvDAO;
/*     */ import com.yc.dao.export.EnvMontorExportDAO;
/*     */ import com.yc.dao.export.FireExtinGuisherExportDAO;
/*     */ import com.yc.dao.export.IExportAll;
/*     */ import com.yc.dao.export.IronTowerExportDAO;
/*     */ import com.yc.dao.export.MachineRoomExportDAO;
/*     */ import com.yc.dao.export.MagnifierExportDAO;
/*     */ import com.yc.dao.export.MainssupplyExportDAO;
/*     */ import com.yc.dao.export.PowerBoxExportDAO;
/*     */ import com.yc.dao.export.PowerSupplyExportDAO;
/*     */ import com.yc.dao.export.StoragebatteryExportDAO;
/*     */ import com.yc.dao.export.TrafficInfoExportDAO;
/*     */ import com.yc.dao.export.TransfersExportDAO;
/*     */ import com.yc.dao.export.TransformerExportDAO;
/*     */ import com.yc.dao.query.QueryBO;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class ExportAllService
/*     */ {
/*  33 */   private dbConnector dbcon = null;
/*     */ 
/*     */   private void dbConInit() {
/*  36 */     if (this.dbcon == null)
/*  37 */       this.dbcon = new dbConnector();
/*     */   }
/*     */ 
/*     */   public void dbConClose() {
/*  41 */     if (this.dbcon != null)
/*  42 */       this.dbcon.closeAll();
/*  43 */     this.dbcon = null;
/*     */   }
/*     */ 
/*     */   private IExportAll getexportAllDao(int tableNo)
/*     */   {
/*  48 */     IExportAll exportAllDao = null;
/*  49 */     switch (tableNo)
/*     */     {
/*     */     case 1:
/*  52 */       exportAllDao = new BTSExportDao();
/*  53 */       break;
/*     */     case 2:
/*  55 */       exportAllDao = new MagnifierExportDAO();
/*  56 */       break;
/*     */     case 3:
/*  58 */       exportAllDao = new PowerBoxExportDAO();
/*  59 */       break;
/*     */     case 4:
/*  61 */       exportAllDao = new StoragebatteryExportDAO();
/*  62 */       break;
/*     */     case 5:
/*  64 */       exportAllDao = new AirconditionExportDAO();
/*  65 */       break;
/*     */     case 6:
/*  67 */       exportAllDao = new FireExtinGuisherExportDAO();
/*  68 */       break;
/*     */     case 7:
/*  70 */       exportAllDao = new BathunderExportDAO();
/*  71 */       break;
/*     */     case 8:
/*  73 */       exportAllDao = new EnvMontorExportDAO();
/*  74 */       break;
/*     */     case 9:
/*  76 */       exportAllDao = new DynamoExportDAO();
/*  77 */       break;
/*     */     case 10:
/*  79 */       exportAllDao = new AcdcDistributionExportDAO();
/*  80 */       break;
/*     */     case 11:
/*  82 */       exportAllDao = new TransformerExportDAO();
/*  83 */       break;
/*     */     case 12:
/*  85 */       exportAllDao = new TransfersExportDAO();
/*  86 */       break;
/*     */     case 13:
/*  88 */       exportAllDao = new MainssupplyExportDAO();
/*  89 */       break;
/*     */     case 14:
/*  91 */       exportAllDao = new AntennaFeederExportDAO();
/*  92 */       break;
/*     */     case 15:
/*  94 */       exportAllDao = new IronTowerExportDAO();
/*  95 */       break;
/*     */     case 16:
/*  97 */       exportAllDao = new MachineRoomExportDAO();
/*  98 */       break;
/*     */     case 17:
/* 100 */       exportAllDao = new PowerSupplyExportDAO();
/* 101 */       break;
/*     */     case 18:
/* 103 */       exportAllDao = new TrafficInfoExportDAO();
/* 104 */       break;
/*     */     case 19:
/* 106 */       exportAllDao = new EnvDAO();
/* 107 */       break;
/*     */     default:
/* 109 */       exportAllDao = new BTSExportDao();
/*     */     }
/* 111 */     return exportAllDao;
/*     */   }
/*     */ 
/*     */   public Map export(List tableList, String strBtsName, String strRegistBeginTime, String strRegistEndTime)
/*     */   {
/* 116 */     Map map = null;
/* 117 */     int totalSize = tableList.size();
/*     */     try
/*     */     {
/* 120 */       dbConInit();
/* 121 */       map = new HashMap();
/* 122 */       IExportAll exportAllDao = null;
/* 123 */       for (int i = 0; i < totalSize; i++)
/*     */       {
/* 125 */         QueryBO bo = (QueryBO)tableList.get(i);
/* 126 */         exportAllDao = getexportAllDao(Integer.parseInt(bo.getId()));
/* 127 */         map.put(bo, exportAllDao.export(this.dbcon, strBtsName, strRegistBeginTime, strRegistEndTime));
/*     */       }
/*     */     }
/*     */     catch (Exception e) {
/* 131 */       e.printStackTrace();
/* 132 */       return null;
/*     */     }
/*     */     finally {
/* 135 */       dbConClose();
/*     */     }
/* 137 */     return map;
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     com.yc.service.export.ExportAllService
 * JD-Core Version:    0.6.2
 */